package com.pai4j.aigc.llm.repository.dao;

import com.pai4j.aigc.llm.entity.LLMUserBindingEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.Optional;

@Repository
public interface ILLMUserBindingDAO extends JpaSpecificationExecutor<LLMUserBindingEntity>, JpaRepository<LLMUserBindingEntity, Long> {

    Optional<LLMUserBindingEntity> findFirstByTenantIdAndUserIdAndActiveOrderByUpdateDateDesc(String tenantId, String userId, Integer active);
}
